#!/bin/sh
# This regression test is a part of SIPp.
# [last_From.value] is the From header's value, without "From: ".
. "`dirname "$0"`/../functions"; init

sippbg -m 1 -sf uas.xml -i 127.0.0.1 -p 21320
if ! sippfg -m 1 -sf uac.xml -i 127.0.0.1 -p 21321 127.0.0.1:21320 \
      -trace_msg -message_file tmp.log -trace_err \
      -timeout 4 -timeout_error >/dev/null 2>&1; then
    fail "call failed"
fi

got="$(sed -e '/message received/,$!d;/^X-/!d;s/[[:space:]]*$//' tmp.log)"
expected="X-From: Alice <sip:alice@localhost>;tag=uniquetag
X-From-Colon: Alice <sip:alice@localhost>;tag=uniquetag
X-Multi-Value: one, two
X-Missing:"
test "$got" = "$expected" || fail "got: $got"
ok
